<template>
  <div class="form-extra-panel" :class="{ 'form-extra-panel-unfold': !isAdvanced }">
    <el-tooltip :content="isAdvanced?'收起':'展开'" placement="left">
      <div class="trigger-btn" @click="toggleAdvanced">
        <el-link :icon="isAdvanced?'el-icon-d-arrow-right':'el-icon-d-arrow-left'" :underline="false" />
      </div>
    </el-tooltip>
    <div class="tabTitle" v-if="showComment" >评论</div>
    <div class="form-extra-panel-main">
      <CommentList :taskId="taskId" />
    </div>
  </div>
</template>

<script>

import CommentList from './CommentList.vue'

export default {
  name: 'CommentExtra',
  components: { CommentList },
  props: {
    taskId: {
      type: String,
      default: ''
    },
    showComment: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {
      isAdvanced: true
    }
  },
  computed: {},
  watch: {},
  methods: {
    toggleAdvanced() {
      this.isAdvanced = !this.isAdvanced;
    }
  }
}
</script>


<style lang="scss" scoped>

.form-extra-panel {
  width: 361px;
  height: 100%;
  flex-shrink: 0;
  border-left: 1px solid #DCDFE6;
  position: relative;
  display: flex;
  flex-direction: column;
  &.form-extra-panel-unfold {
    width: 0;
  }
  & > .ant-tabs {
    flex-shrink: 0;
    &.average-tabs-single {
      .ant-tabs-tab {
        &:hover,
        &.ant-tabs-tab-active .ant-tabs-tab-btn {
          color: inherit !important;
        }
      }
      .ant-tabs-ink-bar {
        display: none;
      }
    }
  }
  .trigger-btn {
    width: 20px;
    height: 42px;
    border-radius: 4px 0px 0px 4px;
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1);
    background: #FFFFFF;
    border: 1px solid #DCDFE6;
    z-index: 10;
    position: absolute;
    left: -20px;
    top: calc(50% - 21px);
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .tabTitle{
    border-bottom: 2px solid #DCDFE6;
    height: 40px;
    line-height: 40px;
    text-align: center;
  }
  .form-extra-panel-main {
    flex: 1;
    overflow: hidden;
  }
}


</style>
